/**
 * @file    list_timer.h
 * @author  Azolla (1228449928@qq.com)
 * @brief   List timer.
 * @version 0.1
 * @date    2025-03-18
 *
 * @copyright Copyright (c) 2025
 * */
#ifndef INCLUDE_LIST_TIMER_H_
#define INCLUDE_LIST_TIMER_H_

#include "list_queue.h"

#include "type.h"

#define listimer_get_time()    10//SysTickTimestamp()  // 1ms

/**
 * @brief Opaque type representing a single listimer
 */
typedef struct list_timer* listimer_handle_t;

/**
 * @brief Timer callback function type
 * @param arg pointer to opaque user-specific data
 */
typedef void (*listimer_cb_t)(void* arg);

void listimer_create(listimer_handle_t *timer, listimer_cb_t callback, void *arg);

void listimer_start(listimer_handle_t timer, uint32_t timeout, bool repetitive); // @suppress("Type cannot be resolved")

void listimer_stop(listimer_handle_t timer);

void listimer_delete(listimer_handle_t timer);

void listimer_deinit(void);

void listimer_process(void);


#endif /* INCLUDE_LIST_TIMER_H_ */
